import com.khh.entity.User;
import com.khh.mapper.UserMapper;
import com.khh.service.UserService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by webrx on 2017-09-23.
 */
public class aa {


    @Test
    public void dd(){
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
        UserMapper i = ctx.getBean(UserMapper.class);
        User user = new User();
        user.setuPhone("12345678901");
        user.setuPassword("111111");
        System.out.println(i.insertSelective(user));
    }

    @Test
    public void aa(){
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
        UserMapper i = ctx.getBean(UserMapper.class);
        User user = new User();
        user.setuPhone("12345678901");
        System.out.println(user.getuPhone());
        System.out.println(i.selectOne(user));
    }

}
